# Maintainer: Felix Yan <felixonamrs@archlinux.org>
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=kstars
pkgver=3.6.4
pkgrel=1
epoch=1
pkgdesc='Desktop Planetarium'
url='https://kde.org/applications/education/kstars/'
arch=(loong64 x86_64)
license=(GPL LGPL FDL)
depends=(stellarsolver libraw kplotting knewstuff knotifyconfig qt5-datavis3d qt5-quickcontrols qt5-websockets qtkeychain-qt5
         libxisf libindi breeze-icons hicolor-icon-theme)
makedepends=(extra-cmake-modules kdoctools eigen)
optdepends=('xplanet: XPlanet support')
source=(https://download.kde.org/stable/$pkgname/$pkgname-$pkgver.tar.xz{,.sig})
sha256sums=('f4c26a25581265507394bbf4f19ea2f323b8615d5ec6c0f9fb22c98ea2060f6d'
            'SKIP')
validpgpkeys=(259D9FCEE9175351965633696D9CE2AEE028C4F3) # Jasem Mutlaq <mutlaqja@ikarustech.com>

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DBUILD_TESTING=OFF \
    -DCMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects" \
    -DCMAKE_CXX_FLAGS="$CXXFLAGS -ffat-lto-objects"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
